﻿<UserControl
    x:Class="GameOfLife.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:uc="clr-namespace:GameOfLife.Controls" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
    <Grid  Style="{StaticResource LayoutRootGridStyle}">
        <Grid.RowDefinitions>
            <RowDefinition Height="42" />
            <RowDefinition Height="*" />
            <RowDefinition Height="42" />
        </Grid.RowDefinitions>

        <Border Grid.Row="1"  Style="{StaticResource ContentBorderStyle}">
            <Grid >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="350" />
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Column="0" SizeChanged="StackPanelSizeChanged" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                    <Border  BorderBrush="Black" BorderThickness="0" >
                        <uc:BoardViewer x:Name="Board" />
                        <!-- tutaj bedzie status control -->
                    </Border>
                </StackPanel>
                <StackPanel Grid.Column="1" VerticalAlignment="Top" >
                    <Border Style="{StaticResource BorderStyle}">
                        <uc:Toolbox x:Name="Toolbox"  />
                    </Border>
                    <Border Style="{StaticResource BorderStyle}">
                        <uc:PlayerToolbox x:Name="Player" />
                    </Border>
                </StackPanel>
            </Grid>
        </Border>

        <Grid  Grid.Row="0"   Style="{StaticResource NavigationGridStyle}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="250" />
                <ColumnDefinition Width="100" />
            </Grid.ColumnDefinitions>
            <Border Grid.Column="0" Style="{StaticResource BrandingBorderStyle}">
                <StackPanel  Style="{StaticResource BrandingStackPanelStyle}">
                    <TextBlock Style="{StaticResource ApplicationNameStyle}" 
                               Text="{Binding Path=Strings.AppTitle, Source={StaticResource LocalizationString}}"/>
                </StackPanel>
            </Border>
            <StackPanel Grid.Column="1" Orientation="Horizontal">
                <TextBlock Text="{Binding Path=Strings.SelectedLang, Source={StaticResource LocalizationString}}"
                            Style="{StaticResource ApplicationNameStyle}" />
                <Image Width="27" Height="19" x:Name="SelectedFlag" Margin="5,0,0,0" />
            </StackPanel>
            <StackPanel Grid.Column="2" Orientation="Horizontal">
                <Button Style="{StaticResource ButtonFlagStyle}" Click="ChangeToLangPl" ToolTipService.ToolTip="{Binding Path=Strings.LangPL, Source={StaticResource LocalizationString}}">
                        <Image  Source="Assets/Images/Flag.pl-PL.png" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
                   
                </Button>
                <Button Style="{StaticResource ButtonFlagStyle}" Click="ChangeToLangEn" ToolTipService.ToolTip="{Binding Path=Strings.LangEN, Source={StaticResource LocalizationString}}">
                    <Image Source="Assets/Images/Flag.en.png" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
                </Button>
            </StackPanel>
        </Grid>

        <Grid Grid.Row="2"  Style="{StaticResource NavigationGridBottomStyle}">
            <Border HorizontalAlignment="Center" Style="{StaticResource BrandingBorderStyle}">
               <HyperlinkButton Content="mawo11@gmail.com" NavigateUri="mailto:mawo11@gmail.com" Style="{StaticResource LinkStyle}" />
            </Border>
        </Grid>

    </Grid>
</UserControl>